<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>External Templates</title>
    <script src="../Scripts/jquery-1.7.2.js" type="text/javascript"></script>
    <script src="../Output/Photon-debug.js" type="text/javascript"></script>
    <script>
        var Person = photon.observable.model.define({firstName:null, lastName:null});

        var templates = new photon.templating.getCache();
        templates.addResourceUrl("ExternalTemplates.Template.htm", function(event) {
            if (!event.isSuccess) {
                alert("Failed to load resources, example doesn't tend to work when running from the file system.")
            }
            else {
                $(function() {
                   $("#edit").html(templates.getHtml("person.edit"));
                   $("#view").html(templates.getHtml("person.view"));
                   photon.binding.applyBindings(new Person(), document);
                })
            }
        });
    </script>
</head>
<body>
   <div id="edit" ></div>
   <div id="view" ></div>
   <div data-bind="data-template:{name:'person.view'}"></div>
</body>
</html>